package cn.ikun.mf.jdbc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

public class Appjdbcdelect {
    public static void main(String[] args) throws Exception{
        Class.forName("com.mysql.jdbc.Driver");
        String url="jdbc:mysql://localhost:3306/test";
        String username="root";
        String password="5240";
        Connection connection = DriverManager.getConnection(url, username, password);
        Statement statement = connection.createStatement();
        String sql="DELETE FROM user WHERE id = 1";
        int i = statement.executeUpdate(sql);
        if(i>0) {
            System.out.println("删除成功!");
        }
    }

}
